﻿/*-------------------------------------------------------------------------
* 命名空间: SiliconSelect.Models/UserModel
* 类       名: UserModel
* 功      能:  
* 时      间:  2023/6/21 10:36:37
* 版      本:  V1.0
* 作      者:  Fioman
* 格      言:  Talk is cheap,show me the code ^_^
*-------------------------------------------------------------------------*/
using SiliconSelect.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Printing;
using System.Text;
using System.Threading.Tasks;

namespace SiliconSelect.Models
{
    public class UserModel : NotifyBase
    {
        /// <summary>
        /// 用户名
        /// </summary>
        private string? _username;

        public string? Username
        {
            get { return _username; }
            set { SetProperty(ref _username, value); }
        }

        /// <summary>
        /// 用户密码
        /// </summary>
        private string? _password;

        public string? Password
        {
            get
            {
                return _password;

                // 只有当前登录的角色是工程师和管理员的时候,才会开放密码查询功能,否则密码就是星号代替
                //if (GlobalValues.UserInfo!.Role == "工程师" || GlobalValues.UserInfo.Role == "管理员")
                //    return _password;
                //else
                //    return new string('*', _password!.Length);
            }
            set { SetProperty(ref _password, value); }
        }

        private string? _role = "操作员";

        /// <summary>
        /// 角色
        /// </summary>
        public string? Role
        {
            get { return _role; }
            set { SetProperty(ref _role, value); }
        }

        /// <summary>
        /// 创建者
        /// </summary>
        private string? _createBy;

        public string? CreateBy
        {
            get { return _createBy; }
            set { SetProperty(ref _createBy, value); }
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        private string? _createTime;

        public string? CreateTime
        {
            get { return _createTime; }
            set { SetProperty(ref _createTime, value); }
        }

        /// <summary>
        /// 最后一次登录时间
        /// </summary>
        private string? _lastLoginTime;

        public string? LastLoginTime
        {
            get { return _lastLoginTime; }
            set { SetProperty(ref _lastLoginTime, value); }
        }


    }
}
